#ifndef GRAPHICS_H_
#define GRAPHICS_H_

#include "fileinfo.h"
#include "graphics_font.h"

class Graphics
{
	public:
		enum button
		{
			BUTTON_PLAY,
			BUTTON_PAUSE,
			BUTTON_STOP,
			BUTTON_PREV,
			BUTTON_NEXT,
			BUTTON_SWITCH
		};

		void init();
		void setTimer(fileTime time);
		void setWiFi(u8 status);
		void setInfo(fileInfo info);
		void setTags(fileInfo info);
		void setBrowserLines(u16 start, std::vector<std::string> *list);
		void setBrowserLines(u16 start, std::vector<fileInfo> *list);
		void setBrowserHighlight(u8 lineno);
		void setButtonHighlight(button button, bool on);

	private:
		u16 *sub_timer_digits_addr;
		u16 *sub_info_chars_addr;
		u16 *sub_wifi_symbols_addr;
		u16 *sub_glyphs_addr;
		u16 *main_buttons_neutral_1_addr;
		u16 *main_buttons_neutral_2_addr;
		u16 *main_highlights_addr;
		u16 *main_bar_addr;
		u16 *main_indicators_addr;
		u16 *main_glyphs_addr;

		void toggleLoading(bool on);
		void setBrowserLinesReal(std::vector<u32> *lines, u8 nlines);
		
		u8 mapChar(char index);
		void hex2glyph(const char* string, unsigned char* output, u8 len);
		std::string addGlyphs(std::string s1, std::string s2);
		std::string glyph64(std::string g);
};

#endif /* GRAPHICS_H_ */
